package com.wenwo.logging.rest;

import com.wenwo.logging.annotation.Log;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: logging
 * @className: TestController.java
 * @description:
 * @author: ZY
 * @create: 2020年08月02日 19:06
 **/
@RestController
@RequestMapping("/test")
public class TestController {

    @Log("测试方法")
    @GetMapping("/testLog")
    public Map<String, Object> testLog(String userId, String username) {
        Map<String, Object> map = new HashMap<>(3);
        map.put("code", 200);
        map.put("message", "请求成功");
        map.put("data", new HashMap<String, String>(2){{
            put("userId", userId);
            put("username", username);
        }});
        return map;
    }

}
